<template>
  <div>
   <van-tabbar
      :route="true"
      active-color="#f66"
      >
      <van-tabbar-item to="/home">
        <span>首页</span>
        <template #icon="props">
          <van-icon class="iconfont" class-prefix="icon" name='home'></van-icon>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/cates" icon="apps-o">分类</van-tabbar-item>
      <van-tabbar-item :badge="cart.lists.length?cart.lists.length:''" to="/cart" icon="cart-o">购物车</van-tabbar-item>
      <van-tabbar-item to="/mine" icon="manager-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState(['cart'])
  }
}
</script>

<style lang="scss" scoped>

</style>
